package com.study.demo_resttemplate.controller;

import com.study.demo_resttemplate.demo.SDKInteface;
import com.study.demo_resttemplate.demo.UserInteface;
import com.study.demo_resttemplate.entity.interfaceentity.IntefaceApi;
import com.study.demo_resttemplate.entity.sdkentity.SDKApiKeyPair;
import com.study.demo_resttemplate.entity.sdkentity.SDKApiSign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name: NFTController
 * @Description: java类作用描述
 * @Author: yn
 * @CreateDate: 2022/7/18 9:59
 * @Remark: 特殊说明
 * @Version: 1.0
 */
@RestController
@RequestMapping("/nft")
public class NFTController {
    @Autowired
    SDKInteface sdkInteface;
    @Autowired
    UserInteface userInteface;

    @RequestMapping("/user")
    public String user() {
//        SDKApiKeyPair sdkApiKeyPair = new SDKApiKeyPair();
//        sdkApiKeyPair.setPriKey("-----BEGIN PRIVATE KEY-----\n" +
//                "MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQgMe+FZ19OX01P0wxT7sC92++18X4bY6vHGS6htM48WhihRANCAAStT9225cWNhtH63YPtM90WXz2NDnKUZxWMDZyeVxfs42/YvM3gJhuGhGVPlK0gdTZD7VkLuFOaZ5nCffY+CHE8\n" +
//                "-----END PRIVATE KEY-----");
//        sdkApiKeyPair.setPubKey("-----BEGIN PUBLIC KEY-----\n" +
//                "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAErU/dtuXFjYbR+t2D7TPdFl89jQ5ylGcVjA2cnlcX7ONv2LzN4CYbhoRlT5StIHU2Q+1ZC7hTmmeZwn32PghxPA==\n" +
//                "-----END PUBLIC KEY-----");
//        IntefaceApi intefaceApi = userInteface.person_down_grade("王胜","ws@qq.com","15751084821","320324199712042974",1,sdkApiKeyPair);
////        userInteface.verify_code(2, "320324199712042974", "王胜")
//        userInteface.submit_by_trusted_platform("sdkApiKeyPair",sdkApiKeyPair,intefaceApi.getData().getString("userIdentification"));
//        System.out.println(intefaceApi);
//        userInteface.verify_code(2,"320324199712042974","王胜");
//        IntefaceApi query = userInteface.query(2, "320324199712042974", "王胜", "407491");
//        System.out.println(query);
        IntefaceApi userInfo = userInteface.getUserInfo();
        System.out.println(userInfo);
        return "123";
    }
}
